home *** CD-ROM | disk | FTP | other *** search
/ 9-Digit Zip Code Directory / 9-Digit Zip Code Directory (American Business Information) (ABIZIP-12).ISO / z4src.zip / Z4Z4KEY.C < prev    next >
C/C++ Source or Header  |  1993-08-12  |  2KB  |  73 lines

  1. //----------------------------------------------------------------------------
  2. //                            MODULE DESCRIPTION
  3. //
  4. //  Module:    z4z4key.c
  5. //   Title:    ZIP+4 Engine
  6. //  Notice:    John M. Weeder
  7. //                 Copyright (c) 1993. All rights reserved.
  8. //             This module contains proprietary information and should be 
  9. //                treated as confidential.
  10. //
  11. //----------------------------------------------------------------------------
  12. //                           MAINTENANCE HISTORY
  13. //
  14. // $Workfile$
  15. // $Revision$
  16. //   $Author$
  17. //     $Date$
  18. //      $Log$    
  19. //
  20. //----------------------------------------------------------------------------
  21. //                             MODULE NARRATIVE
  22. //
  23. //
  24. //    This module contains build a key for a ZIP+4 record.
  25. //    Currently the key consists of the finance number, the first character of
  26. //    the primary name (excluding leading zeros) and the numeric portion of
  27. //    the primary number encoded in BCD.
  28. //    Key length is 3 + 1 + 5 = 9
  29. //
  30. //    The code in this module should be written entirely in C. 
  31. //    Do not use any C++ constructs.
  32. //
  33. //    This module is portable to:
  34. //        DOS 3.X+
  35. //        MS Windows 3.X+
  36. //        OS/2 2.X+
  37. //        OS/2 2.0 PM
  38. //        SCO UNIX.
  39. //
  40. //    The following compilers are supported:
  41. //        MSC 6.0A
  42. //        MSC/C++ 7.0
  43. //        Borland C++ 3.1 for DOS
  44. //        Borland C++ 1.0 for OS/2 2.X
  45. //        SCO UNIX cc
  46. //
  47. //----------------------------------------------------------------------------
  48. #include <z4.h>
  49.  
  50.  
  51. //----------------------------------------------------------------------------
  52. //   Description:    
  53. //    Parameters:
  54. //       Returns:    
  55. //----------------------------------------------------------------------------
  56. VOID FN_E Z4Z4Key(PBYTE pb, PCSZ pcszPof, PCSZ pszPriName, PCSZ pszPriNo)
  57. {
  58.     if (pcszPof == NULL)                        // Set default parameters
  59.         pcszPof = "";
  60.     if (pszPriName == NULL)
  61.         pszPriName = "";
  62.     if (pszPriNo == NULL)
  63.         pszPriNo = "";
  64.  
  65.     stra2b(pb, MAX_FINANCE_BCD, pcszPof, strlen(pcszPof));
  66.     Metaphone(pszPriName, pb + MAX_FINANCE_BCD, 3);
  67.     AlNumKey(pszPriNo, pb + MAX_FINANCE_BCD + 3, 3);
  68.     return ;
  69. }
  70. //----------------------------------------------------------------------------
  71. //------------------------------- End of File --------------------------------
  72. //----------------------------------------------------------------------------
  73.